package com.pengtu.gsj.entity.lzgl;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.pengtu.gsj.entity.app.Attachment;
import com.pengtu.gsj.entity.base.IdEntity;

@Entity
@Table(name = "T_LZ_ROADSUPINNOTE")
public class RoadSupInNote extends IdEntity{

	/**
	 * serialVersionUID:TODO
	 *
	 * @since 1.0.0
	 */
	
	private static final long serialVersionUID = 9124187878696090280L;

	private String signOrg; // 单位名称
	
	private String year; //年份
	
	private Long couCheck; //国检频率（次/年）
	
	private Long proCheck; // 省检频率（次/年）
	
	private String ifInspProc; // 巡查处理是否得当
	
	private String ifJointIns; // 是否开展联合巡查
	
	private String remark; // 备注
	
	private Integer bulletinNumber;   //检测文件数
	
	private List<Attachment> attachments;	//加载附件

	
	public RoadSupInNote() {
	}
	

	public RoadSupInNote(String signOrg, String year, Long couCheck, Long proCheck) {
		this.signOrg = signOrg;
		this.year = year;
		this.couCheck = couCheck;
		this.proCheck = proCheck;
	}


	@Column(name = "SIGNORG")
	public String getSignOrg() {
		return signOrg;
	}

	public void setSignOrg(String signOrg) {
		this.signOrg = signOrg;
	}

	
	@Column(name = "YEAR")
	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	
	@Column(name = "COUCHECK")
	public Long getCouCheck() {
		return couCheck;
	}

	public void setCouCheck(Long couCheck) {
		this.couCheck = couCheck;
	}

	
	@Column(name = "PROCHECK")
	public Long getProCheck() {
		return proCheck;
	}

	public void setProCheck(Long proCheck) {
		this.proCheck = proCheck;
	}

	
	@Column(name = "IFINSPPROC")
	public String getIfInspProc() {
		return ifInspProc;
	}

	public void setIfInspProc(String ifInspProc) {
		this.ifInspProc = ifInspProc;
	}

	
	@Column(name = "IFJOINTINS")
	@JsonInclude(Include.NON_NULL)
	public String getIfJointIns() {
		return ifJointIns;
	}

	public void setIfJointIns(String ifJointIns) {
		this.ifJointIns = ifJointIns;
	}

	
	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Transient
	@JsonIgnore
	public Integer getBulletinNumber() {
		bulletinNumber = attachments.size();
		return bulletinNumber;
	}

	public void setBulletinNumber(Integer bulletinNumber) {
		this.bulletinNumber = bulletinNumber;
	}

	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARTID")
	@JsonIgnore
	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
		this.attachments = attachments;
	}
}
